<admintpl file="header"/></head>
<body>
<div class="wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a>{:L("COUPON_LIST")}</a></li>
        <li><a href="{:U('add')}">{:L("COUPON_ADD")}</a></li>
    </ul>
    <form class="well form-search" method="post" action="{:U('index')}" style='line-height: 46px;'>
        优惠券名称： <input type="text" name="name" value="{:I('request.name')}" placeholder="模糊搜索"/>
        创建时间：<input class="js-date" type="text" name="starts" style="width: 200px;" value="{:I('request.starts')}" placeholder="起始时间">
        <input class="js-date" type="text" name="ends" style="width: 200px;" value="{:I('request.ends')}" placeholder="结束时间"><br />
        <input type="submit" class="btn btn-primary" value="{:L('SEARCH')}"/>
        <a class="btn btn-danger" href="">{:L('CLEAR')}</a>
    </form>
    <form method="post" class="js-ajax-form">
        <table class="table table-hover table-bordered">
            <thead>
            <tr>
            <tr>
                <th align="center">{:L('CHOICE')}</th>
                <th>{:L('COUPON_NAME')}</th>
                <th>{:L('AMOUNT')}</th>
                <th>{:L('IS_SINGLE')}</th>
                <th>{:L('QUANTITY')}</th>
                <th>{:L('EFFECTIVE_DAYS')}</th>
                <th>{:L('CREATEBY')}</th>
                <th>{:L('CREATE_TIME')}</th>
                <th>{:L('UPDATEBY')}</th>
                <th>{:L('UDPATE_TIME')}</th>
                <th>{:L('STATUS')}</th>
                <th align="center">{:L('ACTIONS')}</th>
            </tr>
            </tr>
            </thead>
            <tbody>
            <foreach name="list" item="vo">
                <tr>
                    <td align="center"><input type='checkbox' name='id[]' value='{$vo.id}'/></td>
                    <td>{$vo.name}</td>
                    <td>{$vo.amount}</td>
                    <td><eq name="vo.is_single" value="1">是<else/>否</eq></td>
                    <td>{$vo.quantity}</td>
                    <td>{$vo.effective_days}{:L('DAY')}</td>
                    <td>{$users[$vo['createby']]}</td>
                    <td>{$vo.create_time|date="Y-m-d H:i:s",###}</td>
                    <td>{$users[$vo['updateby']]}</td>
                    <td>{$vo.update_time|date="Y-m-d H:i:s",###}</td>
                    <td>
                        <switch name="vo.status">
                            <case value="0">未启用</case>
                            <case value="1">已启用</case>
                            <case value="2">已结束</case>
                        </switch>
                    <td align="center">
                        <eq name="vo.status" value="0">
                            <a href="{:U('upd',array('id'=>$vo['id']))}">{:L('UPD')}</a> |
                            <a class="js-ajax-dialog-btn" href="{:U('del',array('id'=>$vo['id']))}" data-msg="确认关闭该优惠券吗？"> {:L('CLOSE')}</a>
                        </eq>
                    </td>
                </tr>
            </foreach>
            </tbody>
        </table>
        <div class="pagination">{$page}</div>
    </form>
</div>
<script src="__PUBLIC__/js/common.js"></script>
</body></html>